package com.ruoyi.miniapp.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.miniapp.api.domain.MiniappUser;
import com.ruoyi.miniapp.api.factory.RemoteMiniappUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 用户服务
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteMiniappUserService", value = ServiceNameConstants.MINIAPP_SERVICE, fallbackFactory = RemoteMiniappUserFallbackFactory.class)
public interface RemoteMiniappUserService
{
    @PostMapping("/user/info/{username}")
    R<LoginUser> info(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/user/update")
    R<Boolean> update(@RequestBody MiniappUser miniappUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
